<script setup lang="ts">
import { onHide, onLaunch, onReady, onShow, onUnhandledRejection } from '@dcloudio/uni-app'

import { useAppStore } from '@/store/app'
import { showToast } from '@/utils/uni'
const appStore = useAppStore()
onUnhandledRejection(e => console.log(e, 'error'))
onLaunch(async () => {
  // 设置状态栏高度
  uni.getSystemInfo({
    success: res => {
      // 获取状态栏高度
      appStore.updateSystemInfo(res)
    },
  })
  // 获取程序启动场景
  const launchOptionsInfo = uni.getLaunchOptionsSync()
  appStore.updateLaunchOptionsInfo(launchOptionsInfo)
  console.log('App Launch')
})
onReady(() => {
  // 小程序启动获取参数
})
onShow(() => {})
onHide(() => {
  console.log('App Hide')
})
</script>
<style lang="sass">
@import "app.scss"
</style>
